<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>苏尼特右旗-致贫原因比例</title>
	<meta name="keywords" content="苏尼特右旗-扶贫分布比例">
	<meta name="description" content="苏尼特右旗-扶贫分布比例">
	<link rel="stylesheet" href="$!webPath/index/css/bootstrap.min.css" type="text/css">
	<link rel="stylesheet" href="$!webPath/index/css/reset.css" type="text/css">
	<link rel="stylesheet" href="$!webPath/index/css/index.css" type="text/css">
</head>
<body class="mW-1108">
<div class="PovertyAlleviationWrap">
	<div class="PAP_header">
		<select id="dateSelect" class="PAP_choice">
				<option value="2017">2017</option>
				<option value="2018">2018</option>
				<option value="2019">2019</option>
				<option value="2020">2020</option>
				<option value="2021">2021</option>
				<option value="2022">2022</option>
				<option value="2023">2023</option>
				<option value="2024">2024</option>
				<option value="2025">2025</option>
				<option value="2026">2026</option>
				<option value="2027">2027</option>
				<option value="2028">2028</option>
				<option value="2029">2029</option>
				<option value="2030">2030</option>
		</select>
		<button class="addButton">开始统计</button>
	</div>
	<div class="SCCon">
		<div class="leftEcharts">
			<h3 class="ech_title">苏尼特贫困比例情况</h3>
			<div id="Reason1"></div>
			<h3 class="ech_title">苏尼特贫困分布情况</h3>
			<div id="Reason2"></div>
		</div>
		<div class="rightTable">
			<table class="PAP_Table">
				<thead>
				<tr>
					<th>序号</th>
					<th>乡镇</th>
					<th>一般农户</th>
					<th>一般贫困户</th>
					<th>低保平困户</th>
					<th>五保贫困户</th>
				</tr>
				</thead>
				<tbody>
				#foreach($table in $!resultMap.tableData)
				<tr>
					<td>$!{velocityCount}</td>
					<td>$table.townName</td>
					<td>$table.ybnf</td>
					<td>$table.ybpk</td>
					<td>$table.dbpk</td>
					<td>$table.wbpk</td>
				</tr>
				#end
				<tbody>
				<tfoot>
				<tr>
					<td></td>
					<td>合计</td>
					#foreach($chat in $!resultMap.chatData)
					<td>$!chat.familyCnt</td>
					#end
				</tr>
				</tfoot>
			</table>
		</div>
	</div>
</div>
<script type="text/javascript" src="$!webPath/index/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="$!webPath/index/js/echarts.min.js"></script>
<script type="text/javascript">
	// 贫困户分布情况
	$(function(){
		var chatDataJson = $!chatDataJson
		// 苏尼特贫困原因比例情况
		var incomePic1 = echarts.init(document.getElementById('Reason1'));
		var incomePic1option = {
			color:['#0359a2','#027fb9','#028ebf','#029dc9','#04aac0','#03a6a3','#03c6a3'],
			tooltip : {
				trigger: 'item',
				formatter: "{a} <br/>{b} : {c} ({d}%)"
			},
			series : [
				{
					name: '贫困类型',
					type: 'pie',
					radius : '60%',
					center: ['50%', '50%'],
					data:[
						#foreach($chat in $!resultMap.chatData)
						{value:$!chat.familyCnt,name:'$!chat.povertyAttrName'},
						#end
					],
					itemStyle: {
						emphasis: {
							shadowBlur: 10,
							shadowOffsetX: 0,
							shadowColor: 'rgba(0, 0, 0, 0.5)'
						}
					}
				}
			]
		};

		incomePic1.setOption(incomePic1option);

		// 苏尼特各镇年走访次数
		var incomePic2 = echarts.init(document.getElementById('Reason2'));
		var incomePic2option = {
			title : {
				text : ""
			},
			tooltip : {
				trigger: 'axis',
				axisPointer : {            // 坐标轴指示器，坐标轴触发有效
					type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				}
			},
			// legend: {
			//     data:['贫困人口','贫困户']
			// },
			grid: {
				top: '5%',
				left: '3%',
				right: '4%',
				bottom: '8%',
				containLabel: true
			},
			calculable : true,
			xAxis : [
				{
					// type : 'category',
					data : [
					#foreach($chat in $!resultMap.chatData)
					'$!chat.povertyAttrName',
					#end
					],
					// 标题想显示全部文字则不注释以下代码
					//    "axisLabel":{

					// }
				}
			],
			yAxis : [
				{
					type : 'value'
				}
			],
			series : [
				{
					name:'贫困类型',
					type:'bar',
					data:[
					#foreach($chat in $!resultMap.chatData)
		            '$!chat.familyCnt',
					#end
					],
					barWidth : 15,
					itemStyle:{
						normal:{
							color:'#13ad65'
						}
					},
				}
			]
		};
		incomePic2.setOption(incomePic2option);
		// 点击查询
		$(".addButton").on('click',function () {
			var date = $("#dateSelect").val()
			parent.frames[0].location.href = "$!webPath/sjtj/jzsb/pkfb?date=" + date
		})
		$("#dateSelect").val($!{date})
	})
</script>
</body>
</html>